Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add card feature to msteamsv2_config #4243

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jverger
Copy link

@jverger jverger commented Feb 3, 2025

The goal of this PR is to add an option card to the msteamsv2_config configuration.

If this card option is not used, the default behaviour is keept using title and text values.

Here is an example screenshot of the default result in msteams channel:
image

When using card option, the user is able to customize the msteams card rendering output by using a custom template file and configuring card option to use this template.

Here is an example screenshot of the output result in msteams channel when using card option:
image

To be honest, it's the first time i'm developing in go and create a PR.
Hope it will be not so bad :)

@jverger
Copy link
Author

jverger commented Feb 3, 2025

All checks have passed 🎉 , waiting for someone to merge this PR ⌚

@grobinson-grafana
Copy link
Contributor

I would really like to avoid pushing users towards templating JSON blobs. It has a lot of problems that I've explained in a couple other PRs such as #3799 (comment).

I think supporting cards would be excellent, because visually its a massive improvement, but just not with templated JSON.

@jverger
Copy link
Author

jverger commented Feb 3, 2025

Nevermind, I would have try.
Thank you for your answer.

@grobinson-grafana
Copy link
Contributor

What if you made cards the default instead of a separate field, using the template you have already written? Visually it looks so much better in my opinion!

@jverger
Copy link
Author

jverger commented Feb 7, 2025

Hello @grobinson-grafana !

I'm trying to add a card template in the default.tmpl file but it does not work (and i don't know why 😢 )
The error message looks like this:
level=ERROR source=dispatch.go:360 msg="Notify for alerts failed" component=dispatcher num_alerts=1 err="teams/msteamsv2[0]: notify retry canceled due to unrecoverable error after 1 attempts: template: :1:12: executing \"\" at <{{template \"msteamsv2.default.card\" .}}>: template \"msteamsv2.default.card\" not defined"

I think that i've correctly defined the card template but it does not seem to detect it...

Some help is needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants